package com.xnfh.framework.utils

import android.annotation.SuppressLint
import android.content.Context
import android.provider.ContactsContract.Data
import com.lxj.xpopup.XPopup
import com.lxj.xpopup.core.BasePopupView
import com.lxj.xpopup.impl.LoadingPopupView
import com.xnfh.framework.R
import com.xnfh.framework.log.LogUtil

/**
 * @Description:页面展示loading
 * @author ziheng
 * @date 2022/12/5 16:07
 */
object LoadingViewUtil {
    @SuppressLint("StaticFieldLeak")
    private var loading: BasePopupView? = null

    fun showLoadingDialog(context: Context) {
        loading = XPopup.Builder(context)
            .asLoading(context.getString(R.string.pop_loading))
            .show()
    }

    fun dismissLoadingDialog() {
        loading?.delayDismiss(100)
    }
}